package com.boarsoft.boar.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import com.boarsoft.boar.entity.AppInfo;

/**
 * 服务器监息
 */
public class ServerInfo implements Serializable {
	private static final long serialVersionUID = 692489738425858630L;

	public static final short STATUS_UNKNOWN = -1;
	public static final short STATUS_STOPPED = 0;
	public static final short STATUS_RUNNING = 1;

	public static final short TYPE_APP_SERVER = 0;
	public static final short TYPE_DB_SERVER = 1;
	public static final short TYPE_WEB_SERVER = 2;

	/** 服务器ID */
	private String id;
	/** 所属环境 */
	private String env;
	/** 所属系统 */
	private String projId;
	/** 服务器编号 */
	private String code;
	/** 服务器名称 */
	private String name;
	/** 服务器分组 */
	private String group;
	/** 服务器状态：0：停用（停机），1：启用（运行中） */
	private short status = STATUS_STOPPED;
	/** 服务器类型：0:AppServer,1:DBServer,3:WebServer */
	private short type = TYPE_APP_SERVER;
	/** 服务器IP */
	private String ip;
	/** 服务器描述 */
	private String memo = "";

	/** 服务器（节点）与应用的多对多关系 */
	private Set<AppInfo> apps = new HashSet<AppInfo>();

	public ServerInfo() {
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public short getStatus() {
		return status;
	}

	public void setStatus(short status) {
		this.status = status;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public short getType() {
		return type;
	}

	public void setType(short type) {
		this.type = type;
	}

	public String getProjId() {
		return projId;
	}

	public void setProjId(String projId) {
		this.projId = projId;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public String getEnv() {
		return env;
	}

	public void setEnv(String env) {
		this.env = env;
	}

	public Set<AppInfo> getApps() {
		return apps;
	}

	public void setApps(Set<AppInfo> apps) {
		this.apps = apps;
	}
}